import request from '@/router/axios';

export const getList = (current, size, params) => {
  return request({
    url: '/api/rb-merchant/merchant/yspic/pic_ys/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

export const getListCount = (params) => {
  return request({
    url: '/api/rb-merchant/merchant/yspic/pic_ys/statistics',
    method: 'get',
    params: {
      ...params
    }
  })
}

export const getInfoDetail = (rptAisleOrderCode) => {
  return request({
    url: '/api/rb-merchant/merchant/yspic/pic_ys/detail',
    method: 'get',
    params: {
      rptAisleOrderCode
    }
  })
}

/* 申请退款 */
export const refundOrder = (row) => {
  return request({
    // url: '/api/rb-pay/pay/yinsheng/refundOrder',
    url: '/api/rb-merchant/merchant/yspic/pic_ys/refundOrder',
    method: 'post',
    data: row
  })
}

/* 对账单 导出 */
export const getExport = (params) => {
  return request({
    /*headers: {
      "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
    },
    responseType: 'blob',*/
    url: '/api/rb-merchant/merchant/yspic/pic_ys/export',
    method: 'get',
    params: {
      ...params,
    }
  })
}

/* 是否集团商户 */
export const isGroup = () => {
  return request({
    url: '/api/rb-merchant/merchant/yspic/pic_ys/isGroup',
    method: 'get'
  })
}

// 商户列表
export const getRpiList = (params) => {
  return request({
    url: '/api/rb-merchant/merchant/yspic/pic_ys/listGroup',
    method: 'get',
    params: {
      ...params,
      current:'-1',
      size:'-1'
    }
  })
}

// 门店列表
export const getRpsList = (params) => {
  return request({
    // url: '/api/rb-merchant/merchant/posStore/pos_store/listStore',
    url: '/api/rb-merchant/merchant/posStore/pos_store/listV2',
    method: 'get',
    params: {
      ...params,
      current:'-1',
      size:'-1'
    }
  })
}

// 收银员列表
export const getRpstList = (params) => {
  return request({
    url: '/api/rb-merchant/merchant/yspic/pic_ys/listGroup',
    method: 'get',
    params: {
      ...params,
      current:'-1',
      size:'-1'
    }
  })
}

// 支付状态列表
export const getRptPayState = () => {
  return request({
    url: '/api/blade-system/dict/dictionary?code=bill_statue',
    method: 'get'
  })
}

// 商户列表
export const getRptPayType = () => {
  return request({
    url: '/api/blade-system/dict/dictionary?code=rpt_pay_type',
    method: 'get'
  })
}

// 获取商户
export const getRpiNo= (params) => {
  return request({
    url: '/api/rb-merchant/merchant/yspic/pic_ys/listGroup',
    method: 'get',
    params: {
      ...params,
      current:-1,
      size:-1
    }
  })
}

// 获取门店
export const getListExportStore= (params) => {
  return request({
    url: '/api/rb-merchant/merchant/posStore/pos_store/listExportStore',
    method: 'get',
    params: {
      ...params,
      current:-1,
      size:-1
    }
  })
}
